﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ServerFrame
{
    /// <summary>
    /// 应用层消息处理中心的抽象类
    /// </summary>
    public abstract class AbsHandlerCenter
    {
        /// <summary>
        /// 用户登录服务器
        /// </summary>
        /// /// <param name="token">登录用户</param>
        public abstract void ClientAccept(UserToken token);

        /// <summary>
        /// 用户离开服务器
        /// </summary>
        /// <param name="token">离开用户</param>
        /// <param name="error">离开原因</param>
        public abstract void ClientClose(UserToken token, string error);

        /// <summary>
        /// 接收到的用户信息
        /// </summary>
        /// <param name="token">用户</param>
        /// <param name="message">消息</param>
        public abstract void ReceiveMessage(UserToken token, object message);
    }
}
